package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 物料表
 * </p>
 *
 * @author mt
 * @since 2022-02-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_material")
public class Material extends Model<Material> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
      @TableId("id")
    private Long id;

    /**
     * 供应商ID
     */
    @TableField("supplier_id")
    private Long supplierId;

    /**
     * 分类
     */
    @TableField("category")
    private String category;

    /**
     * 编码
     */
    @TableField("code")
    private String code;

    /**
     * 名称
     */
    @TableField("name")
    private String name;

    /**
     * 包装单位：个，桶，包
     */
    @TableField("packing_unit")
    private String packingUnit;

    /**
     * 最小单位，用于bom计算物料数量单位
     */
    @TableField("smallest_unit")
    private String smallestUnit;

    /**
     * 最小单位数量，如：5000ml，10000g
     */
    @TableField("quantity")
    private Integer quantity;

    /**
     * 规格
     */
    @TableField("spec")
    private String spec;

    /**
     * 描述
     */
    @TableField("description")
    private String description;

    /**
     * 外部编码，用于对照外部系统的编码
     */
    @TableField("external_code")
    private String externalCode;

    /**
     * 启用状态:0 、停用，1、启用
     */
    @TableField("enabled")
    private Integer enabled;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 创建人
     */
    @TableField("creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField("creator_name")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField("updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField("updater_name")
    private String updaterName;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号
     */
    @TableField("version")
    @Version
    private Integer version;

    /**
     * 英文名称
     */
    @TableField("en_name")
    private String enName;

    /**
     * 缩写
     */
    @TableField("abbr")
    private String abbr;


    public static final String ID = "id";

    public static final String SUPPLIER_ID = "supplier_id";

    public static final String CATEGORY = "category";

    public static final String CODE = "code";

    public static final String NAME = "name";

    public static final String PACKING_UNIT = "packing_unit";

    public static final String SMALLEST_UNIT = "smallest_unit";

    public static final String QUANTITY = "quantity";

    public static final String SPEC = "spec";

    public static final String DESCRIPTION = "description";

    public static final String EXTERNAL_CODE = "external_code";

    public static final String ENABLED = "enabled";

    public static final String REMARK = "remark";

    public static final String VALID = "valid";

    public static final String CREATOR_ID = "creator_id";

    public static final String CREATOR_NAME = "creator_name";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATER_NAME = "updater_name";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String EN_NAME = "en_name";

    public static final String ABBR = "abbr";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
